<div class="panel panel--right">
      <div class="search">
        <div class="search__form">
			<form novalidate onkeydown="if(event.keyCode==13){return false;}">
				<input type="text" autocomplete="off" class="search__input" id="prizeName" name="prizeName" value="" placeholder="搜索评选奖项信息" />
				<input type="button" id="search__submit" class="search__submit" value="Send"/>
			</form>
		</div>
		  <div class="search__results">
			  <h3>结果:</h3>
		  </div>
		  <div id="results_content" class="search__results">

		  </div>
      </div>
</div>
<script src="../static/js/check.js"></script>
<script>
	$('#search__submit').click(function () {
		var prizeName=$('#prizeName').val()
		$('#results_content').empty();
		if(prizeName==""||prizeName==null){
			$('#results_content').append(
					"<p style='color: red'><strong>请输入要查询的奖项名！</strong></p>"
			);
		}else{
			$.ajax({
				url: '' + '/prize-info/searchPrize',
				method: 'POST',
				contentType: 'application/json',
				data: JSON.stringify({
					prizeName:prizeName
				}),
				success: function(res) {
					for (var i = 0; i < res.data.length; i++) {
						$('#results_content').append(
								"<div class='search-result' onclick='voteIt(\"" + res.data[i].prizeNum + "\",\"" + res.data[i].prizeName + "\",\"" + res.data[i].allowAmounts + "\")'>" +
								"<div class='search-result__thumb'><img src='assets/images/icons/blue/user.svg' alt='' title=''/></div>" +
								"<div class='search-result__details'>" +
								"  <p><strong>"+res.data[i].prizeName+"</strong> " +
								"</br>结束时间："+res.data[i].endTime.split('T')[0]+"</br>" +
								" 预设名额："+res.data[i].allowAmounts+"</p>" +
								"</div>" +
								"</div>"
						);
					}
				}
			})
		}
	})

$(document).keydown(function (event) {
	if(event.keyCode==13){
		$("#search__submit").click()
	}
})
</script>